import styled from 'styled-components';
import logoPic from '../../statics/logo.png'

export const HeaderWrapper = styled.div`
  position: relative;
  height: 58px;
  border-bottom: 1px solid #f0f0f0;
`;

export const Logo = styled.div`
  position: absolute;
  top: 0;
  left:0;
  display: block;
  width: 100px;
  height: 56px;
  background: url(${logoPic});
  background-size: contain;
`;

export const Nav = styled.div`
  width: 960px;
  padding-right: 70px;
  box-sizing: border-box;
  height: 100%;
  margin: 0 auto;
`;

export const NavItem = styled.div`
  line-height: 56px;
  padding: 0 15px;
  font-size: 17px;
  color: #333;
  cursor: pointer;
  &.left {
      float: left
  }
  &.right {
      float: right
  }
  &active {
      color: #ea6f5a
  }
`;

export const SearchWrapper = styled.div`
   position: relative;
   float: left;
   .slide-enter {
       transition: all .2s ease-out;
   }
   .slide-enter-active {
       width: 240px;
   }
   .slide-exit {
       transition: all .2s ease-out; 
   }
   .slide-exit-active {
       width: 160px;
   }
   .zoom{
       position: absolute;
       right: 5px;
       bottom: 5px;
       width: 30px;
       line-height: 30px;
       border-radius: 15px;
       text-align: center;
       &.focused {
           background: #777;
           color: #fff;
       }
   }
`;

export const NavSearch = styled.input.attrs({
    placeholder: '搜索'
})`
  width: 160px;
  height: 38px;
  border-radius: 19px;
  border: none;
  outline: none; 
  background: #eee;
  margin-top: 9px;
  padding: 0 20px;
  font-size: 14px;
  &::placeholder {
      color: #999
  }
  &.focused{
      width: 240px;
  }
  &.slide-enter {
      transition: all .2s ease-out;
  }
  &.slide-enter-active {
      width: 240px;
  }
  &.slide-exit {
      transition: all .2s ease-out; 
  }
  &.slide-exit-active {
      width: 160px;
  }
`;

export const Addition = styled.div`
  position: absolute;
  right: 30px;
  top: 0;
  height: 56px;
`;

export const Button = styled.div`
  float: right;
  margin-top: 9px;
  line-height: 38px;
  border-radius: 19px;
  border: 1px solid #ec6149;
  padding: 0 20px;
  &.reg {
      color: #ec6149;
      margin-right: 10px;
  }
  &.writting {
    background: red;
    color: #fff;
  }
`;

export const SearchInfo = styled.div`
  position: absolute;
  left: 0;
  top: 56px;
  width: 210px;
  padding: 0 20px 20px;
  box-shadow: 0 0 8px rgba(0,0,0,.2);
  background: #fff;
  ::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border: 12px solid transparent;
    border-bottom-color: #fff;
    left: 20px;
    bottom: 99%;
  }
`;

export const SearchInfoTitle = styled.div`
  margin-top: 20px;
  margin-bottom: 10px;
  line-height: 20px;
  font-size: 14px;
  color: #969696;
`;

export const SearchInfoSwitch = styled.span`
  float: right;
  font-size: 12px;
  cursor: pointer;
  .spin{
    font-size: 12px;
    display: block;
    float:left;
    margin-right: 3px;
    transition: all .2s ease-in;
    transform: rotate(0deg);
    transform-origin: center center;
  }
`;

export const SearchInfoItem = styled.a`
  display: block;
  float: left;
  border-radius: 2px;
  margin-right: 10px;
  margin-top: 5px;
  line-height: 20px;
  padding: 0 3px;
  font-size: 12px;
  border: 1px solid #ddd;
  color: #787878; 
`;

export const SearchInfoList = styled.div`
  overflow: hidden;
`;

